Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Schema): create a schema editor #392

Merged
merged 8 commits into from
Jan 17, 2020
Merged

feat(Schema): create a schema editor #392

merged 8 commits into from
Jan 17, 2020

Conversation

ramfox
Copy link
Member

@ramfox ramfox commented Jan 10, 2020

We now can edit the schema in app!

There is also a non-editable schema that you can view in history.

  • DynamicEditField has inline editing!
  • SchemaItem contains editable info for one column of a schema!
  • Schema displays and allows you to edit the schema of a dataset!

yarn storybook to check out each component on its own, or just take a look at any dataset you have to checkout out the new schema component!

@ramfox ramfox added the feat label Jan 10, 2020
@ramfox ramfox self-assigned this Jan 10, 2020
@ramfox ramfox force-pushed the structure-row branch 3 times, most recently from b5bf989 to 3b26a66 Compare January 14, 2020 23:48
@ramfox ramfox marked this pull request as ready for review January 14, 2020 23:54
@ramfox ramfox changed the title feat(SchemaItem): create DynamicEditField and SchemaItem feat(Schema): create a schema editor Jan 15, 2020
added components:
- overlay/Overlay: used as a pop over, will call `onCancel` if you click outside fo the div, or click the 'x'. The `navigation` prop is optional. Any `children` will overflow-y scroll.
- item/DataType.tsx: defines the `DataTypes` type. Wraps the type name, description, and icon. `type` and `description`, are defined and passed down. May want to refactor to keep description and type defined here, and just use the type to determine all content.
- nav/TabPicker: has size options 'sm' and 'md', and color options 'light' and 'dark'
- overlay/TypePickerOverlay: a version of `Overlay` that lists the DataTypes and passes through the `navigation` component. `typesAndDescriptions` are defined here.
- structure/ColumnType: the component used to show the column type with its icon. Is not 'clickable' if there is no 'onClick' func passed down. I a column has more than one type, it will indicate 'multi'
- structure/TypePicker: takes all these components and creates a TypePicker. Click on the columnType to get a TypePickerOverlay popup. Choose between single or multi mode. The chosen type is kept in the hidden input named for the column (`${column-name}-type`)

This commit also created scss files based on the folder structure:
- chrome
- item
- nav
- overlay
- structure
- type

It also adds a story for each component under the `structure` tab
modeled after the `DatasetReference` component
Ran into a bizarre issue where the `commitEdit` function was only ever pulling from the initial state values, rather then the current state. Had to do a weird hack where I used the `prev` value in the setState functions to get the actual state...

Added a new story for `Form` items
- adjusts ColumnType, TypePicker, and DynamicEditField to have `expanded` view
- adds up, down, left, right carets to `Icon`
- creates `SchemaItem` that expands and retracts
- known bug, DynamicEditField doesn't expand fully at first when you expand SchemaItem
DynamicEditField uses editable `div` rather then `input`
`Schema` is now apart of the `Structure` component! We have schema editing in app :)
make adjustments to the way we handle unknown types and 'any'
internally we have decided to pass all the 'stuff' that a component needs to display as the prop `data`, and that each component should handle their own events
this pr required refactoring to match with this paradigm
Copy link
Contributor

@chriswhong chriswhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's gorgeous! LGTM

@ramfox ramfox merged commit 4d9b4f1 into master Jan 17, 2020
@ramfox ramfox deleted the structure-row branch January 17, 2020 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants